//
//  LoadingTipsView.h
//  TAOVideo
//
//  Created by Lin Eidan on 13-8-10.
//  Copyright (c) 2013年 taomee. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef enum {
    TipsStateNormal,   //正常
    TipsStateReadyLoad, //准备取请求
    TipsStateStartLoad,
    TipsStateLoadedSuccess  //请求成功
} LoadingTipsState;

@protocol LoadingTipsViewDelegate;

@interface LoadingTipsView : UIView

@property (strong, nonatomic) IBOutlet UIView *customView;
@property (weak, nonatomic) id<LoadingTipsViewDelegate>delegate;

//tipView
@property (strong, nonatomic) IBOutlet UIActivityIndicatorView *loadingActView;
@property (strong, nonatomic) IBOutlet UILabel *loadingLabel;
@property (strong, nonatomic) IBOutlet UIImageView *loadingImageView;

@property (strong, nonatomic) UIScrollView *parentView;
@property (assign, nonatomic) BOOL isHasAllLoadedComplete;  //是否所有的页都加载完毕了。。


@property(assign, nonatomic) int totalPage;             //总共多少页
@property(assign, nonatomic) int hasLoadPageNums;       //已经加载了多少页

@property(assign, nonatomic) LoadingTipsState state;
@property(assign, nonatomic) float lastTop;

@property(assign, nonatomic) BOOL isGetDataImmediately; //是否一碰到下边缘就获取新数据

//获得总的数量后，调用，一般是在获得第一页数据后调用
-(void)drawNowInParentView:(UIScrollView *)scrollView andTotalPage:(int )totalPage;
-(void)onScroll;
-(void)endDraing;
-(void)otherPageLoadSuccess;
-(void)otherPageLoadFailed;
-(BOOL)isLoadingOrNot;

@end


@protocol LoadingTipsViewDelegate <NSObject>

@optional
-(void)loadingTipsView:(LoadingTipsView *)loadingTipsView startLoadThePage:(int )page;
@end
